from django.db import models
from rest_framework.renderers import JSONRenderer
# Create your models here.

class VipCourseData(models.Model):
  stu_number = models.CharField(max_length=20,default=None,verbose_name='学習人数')
  sum_number = models.CharField(max_length=20,default=None,verbose_name='合計人数')
  course_score = models.CharField(max_length=20,default=None,verbose_name='課程成績')
  price = models.CharField(max_length=40,default=None,verbose_name='課程価額')
  class Meta:
    verbose_name = 'ビップ課程データ'
class UserInfo(models.Model):
  name = models.CharField(max_length=20,verbose_name='ユーザー名')
  password = models.CharField(max_length=20,verbose_name='パスワード')
  email = models.EmailField(max_length=40,verbose_name='メールアドレス')
  age = models.IntegerField(verbose_name='年齢',default=18)

  def __str__(self) -> str:
    return self.name

  class Meta:
    db_table = 'userinfo'
    verbose_name = 'ユーザーメッセージ'
class Addr(models.Model):
  user = models.ForeignKey('UserInfo',verbose_name='所属ユーザー',on_delete=models.CASCADE)
  mobile = models.CharField(max_length=11,verbose_name='電話番号')
  city = models.CharField(max_length=10,verbose_name='都市')
  info = models.CharField(max_length=120,verbose_name='情報')
  def __str__(self) -> str:
    return self.info
  class Meta:
    verbose_name = '住所'
  
